/*
 * Project: D-Link TR-069
 * 
 * File:   data.h
 * 
 * Author: Levon Baghramyan	
 * 	    
 *
 * Created on September 20, 2011, 11:53 AM
 * 
 * 
 * This object is useful to creating log for ACS_Server e.g.
 * create log and trace files
 * 
 * Copyright (C) 2011 D-Link Company.  All rights reserved.
 */

#ifndef ACSLOGGER_H_
#define ACSLOGGER_H_
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
char str[100];
struct tm *ptr;
time_t lt;

#define conferr strcat(strcat(strcpy(str,__FILE__)," "),__func__)
#define DATA_m "%d-%m-%g:%H:%M"
#define DATA_H "%d-%m-%g:%H:"
#define DATA_D "%d-%m-%g:"
#define DATA_M "-%m-%g:"
#define INFO 0
#define DEBAG 1
#define WORNING 2
#define ERROR 3
#define FATAL 4
/*struct params
{
	int *level;
	int *trace;
	char *mail;
	char *path;
};*/

int conf_parser(char *pars_s);

int params_reading(char *name, int *r, int *level, int *trace, char *mail, char *path);

int read_conf(char *s_path, char *s_mail,int *s_level, int *s_trace, char *rt);

int sendmail(char *mailmessage);

int trace(char *messege);

int logtime(char *s_name, char *rtime);

int logtr(char *message,char *ID_client,int level,const char *conff);


#endif /* ACSLOGGER_H_ */

